<?php
/*
	首页
*/
//cfc('core')->checklogin();
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
if($_RQ['op']=='list'){
	$return['list']=array();
	$post=get_postdata();	
	$return['k']=0;
	$params=array('uniacid'=>$_SESSION['uniacid']);
	if(!empty($post['keyword'])){
		$params['goodsName like']='%'.trim($post['keyword']).'%';
		$return['params']['goodsName']=$post['params']['keyword'];
	}
	if($post['type']=='zy'){
		$params['isJdSale']=1;
		
	}
	
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	
	$orderby='paixu desc';
	if($post['type']=='jiage'){
		
		$orderby='wlUnitPrice asc';
	}
	$total='';
	$return['list']=pdo_getslice('jy_jdk_goods',$params,array($pindex,$psize),$total,$fields,'',$orderby);
	
	//print_r($return['list']);exit();
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	set_html('title',$setting['title']?'首页-'.$setting['title']:'搜索-京东客');
	exi($return);
}

	
?>